//
//  LcFont.m
//  18Birdies
//
//  Created by Lc on 15/3/31.
//  Copyright (c) 2015年 Lc. All rights reserved.
//

#import "LcFont.h"
#import "LcPreconditions.h"
#import "NSString+Lc.h"
#import "UIColor+Lc.h"

#define LC_FONT_THIN @".HelveticaNeueInterface-Thin"
#define LC_FONT_LIGHT @".HelveticaNeueInterface-Light"
#define LC_FONT_REGULAR @".HelveticaNeueInterface-Regular"
#define LC_FONT_MEDIUM @".HelveticaNeueInterface-Medium"
#define LC_FONT_BOLD @".HelveticaNeueInterface-Bold"
#define LC_FONT_HEAVY @".HelveticaNeueInterface-Heavy"

#define LC_FONT_THIN2 @"HelveticaNeue-Thin"
#define LC_FONT_LIGHT2 @"HelveticaNeue-Light"
#define LC_FONT_REGULAR2 @"HelveticaNeue"
#define LC_FONT_MEDIUM2 @"HelveticaNeue-Medium"
#define LC_FONT_BOLD2 @"HelveticaNeue-Bold"
// no heavy font of HelveticaNeue, use bold instead
#define LC_FONT_HEAVY2 @"HelveticaNeue-Bold"

#define LC_FONT_DING_BOLD @"DINCond-Bold"

@interface LcFont ()

@property(nonatomic, strong) UIFont* font;
@property(nonatomic, assign) CGFloat size;
@property(nonatomic, strong) UIColor* color;
@property(nonatomic, assign) LcFontWeight weight;

@end

@implementation LcFont

+ (void)initialize {
  /*
  #ifdef DEBUG
    NSArray* familyNames = [UIFont familyNames];
    LcLog(@"%@", familyNames);
    for (NSString* familyName in familyNames) {
      NSArray* fontNames = [UIFont fontNamesForFamilyName:familyName];
      LcLog(@"%@=%@", familyName, fontNames);
    }
  #endif
  */
}

- (instancetype)initWithFontWeight:(LcFontWeight)fontWeight
                              size:(CGFloat)size
                             color:(UIColor*)color {
  self = [super init];
  if (self) {
    _size = size;
    _weight = fontWeight;
    _color = color;
  }
  return self;
}

- (instancetype)copyWithZone:(NSZone*)zone {
  LcFont* copyFont = [LcFont allocWithZone:zone];
  copyFont.weight = self.weight;
  copyFont.size = self.size;
  copyFont.color = self.color;
  return copyFont;
}

- (UIFont*)gentFontWithWeight:(LcFontWeight)fontWeight size:(CGFloat)size {
  UIFont* font = nil;
  if ([UIFont.class respondsToSelector:@selector(systemFontOfSize:weight:)]) {
    CGFloat weight = 0;
    switch (fontWeight) {
      case LC_FONT_WEIGHT_THIN:
        weight = UIFontWeightThin;
        break;
      case LC_FONT_WEIGHT_LIGHT:
        weight = UIFontWeightLight;
        break;
      case LC_FONT_WEIGHT_REGULAR:
        weight = UIFontWeightRegular;
        break;
      case LC_FONT_WEIGHT_MEDIUM:
        weight = UIFontWeightMedium;
        break;
      case LC_FONT_WEIGHT_BOLD:
        weight = UIFontWeightBold;
        break;
      case LC_FONT_WEIGHT_HEAVY:
        weight = UIFontWeightHeavy;
        break;
      default:
        LC_FAIL();
        break;
    }
    font = [UIFont systemFontOfSize:size weight:weight];
    LC_CHECK_NOT_NULL(font);
  } else {
    NSString* fontName = nil;
    switch (fontWeight) {
      case LC_FONT_WEIGHT_THIN:
        fontName = LC_FONT_THIN;
        break;
      case LC_FONT_WEIGHT_LIGHT:
        fontName = LC_FONT_LIGHT;
        break;
      case LC_FONT_WEIGHT_REGULAR:
        fontName = LC_FONT_REGULAR;
        break;
      case LC_FONT_WEIGHT_MEDIUM:
        fontName = LC_FONT_MEDIUM;
        break;
      case LC_FONT_WEIGHT_BOLD:
        fontName = LC_FONT_BOLD;
        break;
      case LC_FONT_WEIGHT_HEAVY:
        fontName = LC_FONT_HEAVY;
        break;
      default:
        LC_FAIL();
        break;
    }
    LC_CHECK_NOT_EMPTY(fontName);
    font = [UIFont fontWithName:fontName size:size];
    if (font == nil) {
      switch (fontWeight) {
        case LC_FONT_WEIGHT_THIN:
          fontName = LC_FONT_THIN2;
          break;
        case LC_FONT_WEIGHT_LIGHT:
          fontName = LC_FONT_LIGHT2;
          break;
        case LC_FONT_WEIGHT_REGULAR:
          fontName = LC_FONT_REGULAR2;
          break;
        case LC_FONT_WEIGHT_MEDIUM:
          fontName = LC_FONT_MEDIUM2;
          break;
        case LC_FONT_WEIGHT_BOLD:
          fontName = LC_FONT_BOLD2;
          break;
        case LC_FONT_WEIGHT_HEAVY:
          fontName = LC_FONT_HEAVY2;
          break;
        default:
          LC_FAIL();
          break;
      }
      font = [UIFont fontWithName:fontName size:size];
      if (font == nil) {
        switch (fontWeight) {
          case LC_FONT_WEIGHT_THIN:
          case LC_FONT_WEIGHT_LIGHT:
          case LC_FONT_WEIGHT_REGULAR:
            font = [UIFont systemFontOfSize:size];
            break;
          case LC_FONT_WEIGHT_MEDIUM:
          case LC_FONT_WEIGHT_BOLD:
          case LC_FONT_WEIGHT_HEAVY:
            font = [UIFont boldSystemFontOfSize:size];
            break;
          default:
            LC_FAIL();
            break;
        }
      }
    }
    LC_CHECK_NOT_NULL(font);
  }
  return font;
}

- (FontSizeBlock)fontSize {
  return ^(CGFloat fontSize) {
    self.size = fontSize;
    return self;
  };
}

- (FontWeightBlock)fontWeight {
  return ^(LcFontWeight fontWeight) {
    self.weight = fontWeight;
    return self;
  };
}

- (FontColorBlock)fontColor {
  return ^(UIColor* fontColor) {
    self->_color = fontColor;
    return self;
  };
}

- (void)setSize:(CGFloat)size {
  _size = size;
  _font = nil;
}

- (void)setWeight:(LcFontWeight)weight {
  _weight = weight;
  _font = nil;
}

- (UIFont*)font {
  if (_font == nil) {
    _font = [self gentFontWithWeight:_weight size:_size];
  }
  return _font;
}

+ (LcFont*)fontWithColor:(UIColor*)color fontWeight:(LcFontWeight)weight andFontSize:(int)size {
  return [[self alloc] initWithFontWeight:weight size:size color:color];
}

+ (LcFont*)dt60 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_THIN size:60 color:LC_COLOR_DARK];
}

+ (LcFont*)dm40 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:40 color:LC_COLOR_DARK];
}

+ (LcFont*)bt31 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_THIN size:31 color:LC_COLOR_BLUE];
}

+ (LcFont*)dr29 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:29 color:LC_COLOR_DARK];
}

+ (LcFont*)dr28 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:28 color:LC_COLOR_DARK];
}

+ (LcFont*)ob28 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:28 color:LC_COLOR_ORANGE];
}

+ (LcFont*)ob24 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:24 color:LC_COLOR_ORANGE];
}

+ (LcFont*)dm28 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:28 color:LC_COLOR_DARK];
}

+ (LcFont*)dm26 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:26 color:LC_COLOR_DARK];
}

+ (LcFont*)dr24 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:24 color:LC_COLOR_DARK];
}

+ (LcFont*)db24 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:24 color:LC_COLOR_DARK];
}

+ (LcFont*)dr20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:20 color:LC_COLOR_DARK];
}

+ (LcFont*)bt25 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_THIN size:25 color:LC_COLOR_BLUE];
}

+ (LcFont*)bt20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_THIN size:20 color:LC_COLOR_BLUE];
}

+ (LcFont*)gm26 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:26 color:LC_COLOR_GRAY];
}

+ (LcFont*)wm26 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:26 color:LC_COLOR_WHITE];
}

+ (LcFont*)wb20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:20 color:LC_COLOR_WHITE];
}

+ (LcFont*)wm20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:20 color:LC_COLOR_WHITE];
}

+ (LcFont*)wl20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_LIGHT size:20 color:LC_COLOR_WHITE];
}

+ (LcFont*)wl22 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_LIGHT size:22.0 color:LC_COLOR_WHITE];
}

+ (LcFont*)dl15 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_LIGHT size:15.0 color:LC_COLOR_DARK];
}

+ (LcFont*)dl20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_LIGHT size:20 color:LC_COLOR_DARK];
}

+ (LcFont*)dm20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:20 color:LC_COLOR_DARK];
}

+ (LcFont*)db20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:20 color:LC_COLOR_DARK];
}

+ (LcFont*)gr29 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:29 color:LC_COLOR_GRAY];
}

+ (LcFont*)gl20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_LIGHT size:20 color:LC_COLOR_GRAY];
}

+ (LcFont*)gb20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:20 color:LC_COLOR_GRAY];
}

+ (LcFont*)gm20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:20 color:LC_COLOR_GRAY];
}

+ (LcFont*)gr20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:20 color:LC_COLOR_GRAY];
}

+ (LcFont*)sl20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_LIGHT size:20 color:LC_COLOR_SAND];
}

+ (LcFont*)bb20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:20 color:LC_COLOR_BLUE];
}

+ (LcFont*)bm20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:20 color:LC_COLOR_BLUE];
}

+ (LcFont*)wb22 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:22 color:LC_COLOR_WHITE];
}

+ (LcFont*)wb17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:17 color:LC_COLOR_WHITE];
}

+ (LcFont*)wl17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_LIGHT size:17 color:LC_COLOR_WHITE];
}

+ (LcFont*)br20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:20 color:LC_COLOR_BLUE];
}

+ (LcFont*)br17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:17 color:LC_COLOR_BLUE];
}

+ (LcFont*)bm17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:17 color:LC_COLOR_BLUE];
}

+ (LcFont*)dr17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:17 color:LC_COLOR_DARK];
}

+ (LcFont*)db17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:17 color:LC_COLOR_DARK];
}

+ (LcFont*)dm17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:17 color:LC_COLOR_DARK];
}

+ (LcFont*)gr17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:17 color:LC_COLOR_GRAY];
}

+ (LcFont*)gm17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:17 color:LC_COLOR_GRAY];
}

+ (LcFont*)gb17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:17 color:LC_COLOR_GRAY];
}

+ (LcFont*)sgr29 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR
                                     size:29
                                    color:LC_COLOR_SECONDARY_GRAY];
}

+ (LcFont*)sgb17 {
  return
      [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:17 color:LC_COLOR_SECONDARY_GRAY];
}

+ (LcFont*)sgr17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR
                                     size:17
                                    color:LC_COLOR_SECONDARY_GRAY];
}

+ (LcFont*)sr17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:17 color:LC_COLOR_SAND];
}

+ (LcFont*)st22 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_THIN size:22.0 color:LC_COLOR_SAND];
}

+ (LcFont*)wr17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:17 color:LC_COLOR_WHITE];
}

+ (LcFont*)wm17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:17 color:LC_COLOR_WHITE];
}

+ (LcFont*)bb17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:17 color:LC_COLOR_BLUE];
}

+ (LcFont*)cb17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:17 color:LC_COLOR_GOLD];
}

+ (LcFont*)rr17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:17 color:LC_COLOR_WARNING];
}

+ (LcFont*)rr14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14 color:LC_COLOR_WARNING];
}

+ (LcFont*)cb14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14 color:LC_COLOR_GOLD];
}

+ (LcFont*)wb15 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:15 color:LC_COLOR_WHITE];
}

+ (LcFont*)wb14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14 color:LC_COLOR_WHITE];
}

+ (LcFont*)wm14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:14 color:LC_COLOR_WHITE];
}

+ (LcFont*)wl14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_LIGHT size:14 color:LC_COLOR_WHITE];
}

+ (LcFont*)bb15 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:15 color:LC_COLOR_BLUE];
}

+ (LcFont*)bb14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14 color:LC_COLOR_BLUE];
}

+ (LcFont*)bm14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:14 color:LC_COLOR_BLUE];
}
+ (LcFont*)bm11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:11 color:LC_COLOR_BLUE];
}
+ (LcFont*)bb11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:11 color:LC_COLOR_BLUE];
}
+ (LcFont*)br11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:11 color:LC_COLOR_BLUE];
}
+ (LcFont*)dm11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:11 color:LC_COLOR_DARK];
}
+ (LcFont*)db11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:11 color:LC_COLOR_DARK];
}
+ (LcFont*)dr11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:11 color:LC_COLOR_DARK];
}
+ (LcFont*)dr10 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:10.0 color:LC_COLOR_DARK];
}

+ (LcFont*)dr14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14 color:LC_COLOR_DARK];
}
+ (LcFont*)dm15 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:15 color:LC_COLOR_DARK];
}
+ (LcFont*)dm14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:14 color:LC_COLOR_DARK];
}
+ (LcFont*)db14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14 color:LC_COLOR_DARK];
}

+ (LcFont*)sb12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:12.0 color:LC_COLOR_SAND];
}

+ (LcFont*)sb14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14 color:LC_COLOR_SAND];
}

+ (LcFont*)gr14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14 color:LC_COLOR_GRAY];
}

+ (LcFont*)gm14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:14 color:LC_COLOR_GRAY];
}

+ (LcFont*)gb14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14 color:LC_COLOR_GRAY];
}

+ (LcFont*)br14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14 color:LC_COLOR_BLUE];
}

+ (LcFont*)w60r14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14 color:LC_COLOR_WHITE_60];
}

+ (LcFont*)w80m17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:17 color:LC_COLOR_WHITE_80];
}

+ (LcFont*)w80r14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14 color:LC_COLOR_WHITE_80];
}

+ (LcFont*)w80m14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:14 color:LC_COLOR_WHITE_80];
}

+ (LcFont*)w80b14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14 color:LC_COLOR_WHITE_80];
}

+ (LcFont*)w60m14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:14 color:LC_COLOR_WHITE_60];
}

+ (LcFont*)sgr14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR
                                     size:14
                                    color:LC_COLOR_SECONDARY_GRAY];
}

+ (LcFont*)sr14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14 color:LC_COLOR_SAND];
}
+ (LcFont*)rb14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14 color:LC_COLOR_WARNING];
}

+ (LcFont*)rr11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:11 color:LC_COLOR_WARNING];
}

+ (LcFont*)wr14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14 color:LC_COLOR_WHITE];
}

+ (LcFont*)wb32 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:32 color:LC_COLOR_WHITE];
}

+ (LcFont*)wr24 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:24 color:LC_COLOR_WHITE];
}

+ (LcFont*)wb24 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:24 color:LC_COLOR_WHITE];
}

+ (LcFont*)wr20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:20 color:LC_COLOR_WHITE];
}

+ (LcFont*)gr12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:12 color:LC_COLOR_GRAY];
}

+ (LcFont*)gm12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:12 color:LC_COLOR_GRAY];
}

+ (LcFont*)bb12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:12 color:LC_COLOR_BLUE];
}

+ (LcFont*)bm12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:12 color:LC_COLOR_BLUE];
}

+ (LcFont*)sgr12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR
                                     size:12
                                    color:LC_COLOR_SECONDARY_GRAY];
}
+ (LcFont*)sgb12 {
  return
      [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:12 color:LC_COLOR_SECONDARY_GRAY];
}
+ (LcFont*)sgm11 {
  return
      [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:11 color:LC_COLOR_SECONDARY_GRAY];
}
+ (LcFont*)sgr11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR
                                     size:11
                                    color:LC_COLOR_SECONDARY_GRAY];
}
+ (LcFont*)sr12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:12 color:LC_COLOR_SAND];
}
+ (LcFont*)wm12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:12 color:LC_COLOR_WHITE];
}
+ (LcFont*)wr12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:12 color:LC_COLOR_WHITE];
}
+ (LcFont*)wb12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:12 color:LC_COLOR_WHITE];
}
+ (LcFont*)wb11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:11 color:LC_COLOR_WHITE];
}
+ (LcFont*)wm11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:11 color:LC_COLOR_WHITE];
}
+ (LcFont*)wr11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:11 color:LC_COLOR_WHITE];
}
+ (LcFont*)gb11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:11 color:LC_COLOR_GRAY];
}

+ (LcFont*)gb10 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:10 color:LC_COLOR_GRAY];
}

+ (LcFont*)gr11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:11 color:LC_COLOR_GRAY];
}
+ (LcFont*)cb12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:12 color:LC_COLOR_GOLD];
}
+ (LcFont*)gb12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:12 color:LC_COLOR_GRAY];
}
+ (LcFont*)db12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:12 color:LC_COLOR_DARK];
}

+ (LcFont*)gm11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:11 color:LC_COLOR_GRAY];
}

+ (LcFont*)gr10 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:10 color:LC_COLOR_GRAY];
}

+ (LcFont*)wr10 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:10 color:LC_COLOR_WHITE];
}
+ (LcFont*)wb10 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:10 color:LC_COLOR_WHITE];
}

+ (LcFont*)sgr10 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR
                                     size:10
                                    color:LC_COLOR_SECONDARY_GRAY];
}

// third gray
+ (LcFont*)tgr14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14 color:LC_COLOR_THIRD_GRAY];
}

+ (LcFont*)tgm14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:14 color:LC_COLOR_THIRD_GRAY];
}

+ (LcFont*)tgb14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14 color:LC_COLOR_THIRD_GRAY];
}

+ (LcFont*)tgb18 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:18 color:LC_COLOR_THIRD_GRAY];
}

+ (LcFont*)wh10 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_HEAVY size:10 color:LC_COLOR_WHITE];
}

+ (LcFont*)wr9 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:9 color:LC_COLOR_WHITE];
}

+ (LcFont*)sgb14 {
  return
      [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14.0 color:LC_COLOR_SECONDARY_GRAY];
}

+ (LcFont*)dl14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_LIGHT size:14.0 color:LC_COLOR_DARK];
}
+ (LcFont*)dl12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_LIGHT size:12.0 color:LC_COLOR_DARK];
}
+ (LcFont*)dr12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:12.0 color:LC_COLOR_DARK];
}

+ (LcFont*)dm12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:12.0 color:LC_COLOR_DARK];
}

+ (LcFont*)yardageWb14 {
  NSString* fontName = @"DIN Condensed";
  NSArray* array = [UIFont fontNamesForFamilyName:fontName];
  for (NSString* str in array) {
    if ([str containsIgnoreCase:@"bold"]) {
      fontName = str;
      break;
    }
  }
  UIFont* font = [UIFont fontWithName:fontName size:14];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_WHITE;
  return lcFont;
}

+ (LcFont*)yardageWr14 {
  UIFont* font = [UIFont fontWithName:@"DIN Condensed" size:14.0];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_WHITE;
  return lcFont;
}

+ (LcFont*)yardageWr17 {
  UIFont* font = [UIFont fontWithName:@"DIN Condensed" size:17.0];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_WHITE;
  return lcFont;
}

+ (LcFont*)yardageBb19 {
  NSString* fontName = @"DIN Condensed";
  NSArray* array = [UIFont fontNamesForFamilyName:fontName];
  for (NSString* str in array) {
    if ([str containsIgnoreCase:@"bold"]) {
      fontName = str;
      break;
    }
  }
  UIFont* font = [UIFont fontWithName:fontName size:19];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_DARK;
  return lcFont;
}

+ (LcFont*)yardageWb22 {
  NSString* fontName = @"DIN Condensed";
  NSArray* array = [UIFont fontNamesForFamilyName:fontName];
  for (NSString* str in array) {
    if ([str containsIgnoreCase:@"bold"]) {
      fontName = str;
      break;
    }
  }
  UIFont* font = [UIFont fontWithName:fontName size:22];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_WHITE;
  return lcFont;
}

+ (LcFont*)yardageWr24 {
  UIFont* font = [UIFont fontWithName:@"DIN Condensed" size:24.0];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_WHITE;
  return lcFont;
}

+ (LcFont*)yardageGr29 {
  UIFont* font = [UIFont fontWithName:@"DIN Condensed" size:29.0];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_GRAY;
  return lcFont;
}

+ (LcFont*)caddyWb10 {
  NSString* fontName = @"HelveticaNeue-Bold";
  UIFont* font = [UIFont fontWithName:fontName size:10];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_WHITE;
  return lcFont;
}

+ (LcFont*)caddyWb14 {
  NSString* fontName = @"HelveticaNeue-Bold";
  UIFont* font = [UIFont fontWithName:fontName size:14];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_WHITE;
  return lcFont;
}

+ (LcFont*)caddyWr14 {
  UIFont* font = [UIFont fontWithName:@"HelveticaNeue" size:14.0];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_WHITE;
  return lcFont;
}

+ (LcFont*)caddyBb19 {
  NSString* fontName = @"HelveticaNeue-Bold";
  UIFont* font = [UIFont fontWithName:fontName size:19];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_DARK;
  return lcFont;
}

+ (LcFont*)caddyWr24 {
  UIFont* font = [UIFont fontWithName:@"HelveticaNeue" size:24.0];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_WHITE;
  return lcFont;
}

+ (LcFont*)caddyGr29 {
  UIFont* font = [UIFont fontWithName:@"HelveticaNeue" size:29.0];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_GRAY;
  return lcFont;
}

+ (LcFont*)caddyWb32 {
  NSString* fontName = @"HelveticaNeue-Bold";
  UIFont* font = [UIFont fontWithName:fontName size:32];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_WHITE;
  return lcFont;
}

+ (LcFont*)caddyWb11 {
  NSString* fontName = @"HelveticaNeue-Bold";
  UIFont* font = [UIFont fontWithName:fontName size:11];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_WHITE;
  return lcFont;
}

+ (LcFont*)team1b14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14.0 color:LC_COLOR_TEAM_ONE];
}
+ (LcFont*)team2b14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14.0 color:LC_COLOR_TEAM_TWO];
}

+ (LcFont*)jb14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14.0 color:LC_COLOR_COIN];
}

+ (LcFont*)er24 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:24.0 color:LC_COLOR_WIN];
}

+ (LcFont*)eb17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:17.0 color:LC_COLOR_WIN];
}

+ (LcFont*)eb14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14.0 color:LC_COLOR_WIN];
}
+ (LcFont*)em14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:14.0 color:LC_COLOR_WIN];
}
+ (LcFont*)er14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14.0 color:LC_COLOR_WIN];
}

+ (LcFont*)lrr24 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:24.0 color:LC_COLOR_LOSS];
}

+ (LcFont*)lrm20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:20.0 color:LC_COLOR_LOSS];
}

+ (LcFont*)lrb17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:17.0 color:LC_COLOR_LOSS];
}

+ (LcFont*)lrm17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:17.0 color:LC_COLOR_LOSS];
}

+ (LcFont*)ob17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:17.0 color:LC_COLOR_ORANGE];
}

+ (LcFont*)or17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:17.0 color:LC_COLOR_ORANGE];
}

+ (LcFont*)lrb14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14.0 color:LC_COLOR_LOSS];
}
+ (LcFont*)lrm14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:14.0 color:LC_COLOR_LOSS];
}
+ (LcFont*)lrr14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14.0 color:LC_COLOR_LOSS];
}

+ (LcFont*)or14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14.0 color:LC_COLOR_ORANGE];
}

+ (LcFont*)ob11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD
                                     size:11.0
                                    color:LC_COLOR_PINEAPPLE_ORANGE];
}

+ (LcFont*)lrb11 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:11.0 color:LC_COLOR_LOSS];
}

+ (LcFont*)pob14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD
                                     size:14.0
                                    color:LC_COLOR_PINEAPPLE_ORANGE];
}

+ (LcFont*)pob17 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD
                                     size:17.0
                                    color:LC_COLOR_PINEAPPLE_ORANGE];
}
+ (LcFont*)pob20 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD
                                     size:20.0
                                    color:LC_COLOR_PINEAPPLE_ORANGE];
}

+ (LcFont*)satisfyWr24 {
  UIFont* font = [UIFont fontWithName:@"Satisfy" size:24.0];
  LcFont* lcFont = [[self alloc] init];
  lcFont->_font = font;
  lcFont->_color = LC_COLOR_WHITE;
  return lcFont;
}

+ (LcFont*)g1b12 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD
                                     size:12.0
                                    color:LC_COLOR_BACKGROUND_BLUE_GRAY_1];
}

#pragma mark - fifth gray
+ (LcFont*)fgr10 {
  return
      [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:10.0 color:LC_COLOR_FIFTH_GRAY];
}

+ (LcFont*)fgr14 {
  return
      [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_REGULAR size:14.0 color:LC_COLOR_FIFTH_GRAY];
}

+ (LcFont*)fgm14 {
  return
      [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_MEDIUM size:14.0 color:LC_COLOR_FIFTH_GRAY];
}

+ (LcFont*)fgb14 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:14.0 color:LC_COLOR_FIFTH_GRAY];
}

+ (LcFont*)fgb18 {
  return [[self alloc] initWithFontWeight:LC_FONT_WEIGHT_BOLD size:18.0 color:LC_COLOR_FIFTH_GRAY];
}

- (LcFont*)scaledFont:(float)scale {
  LC_CHECK_TRUE(scale != 0);
  return [[LcFont alloc] initWithFontWeight:self.weight size:self.size * scale color:self.color];
}

@end
